package com.dao;

import com.bean.GroupMessage;
import com.bean.Message;
import com.db.DBUtil;

import java.sql.SQLException;

public class GroupMessageDao {

    DBUtil dbUtil = new DBUtil();

    /**
     * 保存群消息
     * @param obj
     */
    public void saveGroupMessage(GroupMessage obj){
        String sql="insert into group_message(from,group_qq,text) values" +
                "('"+obj.getFrom()+"','"+obj.getGroupQQ()+"',"
                +"'"+obj.getText()+"')";
        try {
            dbUtil.insertOrUpdate(sql);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (SQLException e) {
            e.printStackTrace();
        }finally {
            dbUtil.close();
        }
    }

}
